package com.example.springcloudindex.web.feign;

import com.example.springcloudindex.bean.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(contextId = "feign",value="spring-cloud-order",fallback = OrderActionHystrix.class)
public interface OrderAction {
    @RequestMapping("order")
    String order();
    // hello?name=xxxx
    @RequestMapping("hello")
    String hello(@RequestParam("name") String name);

    @RequestMapping("hello/{name}")
    String helloA(@PathVariable("name") String name);
    @RequestMapping("add")
    int add(@RequestParam int a, @RequestParam int b);

    @RequestMapping("showMe")
    User showme(@RequestBody User user,
                @RequestParam String newName);
}
